<me:UIKD x:Class="WPFExcelReport.TSKD02"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:WF="clr-namespace:WPFExcelReport;assembly=TICC_WFEVENTS"  
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization" 
                    x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIKD.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:NOTBoolToVisibilityConverter x:Key="nbv"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UIKD.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0">
            <WrapPanel  >
                <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=客户:}}"></TextBlock>
                <WF:TBTNEXE IsManage="{Binding IsManage,ElementName=TV}" DLL="ITXUI" 
                            CMD="KD02" STWNW="MainWindow" 
                            KRS="{Binding KUNDNR,ElementName=TV}"
                   IsInfo="False" 
                     />
                <TextBox  HorizontalAlignment="Left"  
                          CharacterCasing="Upper"
                           Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}"
                           Text="{Binding ART,ElementName=TV}" 
                           Background="Yellow"
                           Width="80" />
                <ComboBox x:Name="cSKD"
                    DropDownOpened="ComboBox_DropDownOpened" 
                    Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}"
                    IsEditable="True" 
                    Width="Auto"  
                    MinWidth="100" 
                    SelectedValuePath="KDKUNDNR" 
                    DisplayMemberPath="KDKUNDNA"
                    ItemsSource="{Binding Source={StaticResource vwMaster}}" 
                    IsSynchronizedWithCurrentItem="True"  
            >
                </ComboBox  >
                <TextBlock HorizontalAlignment="Left"  
                           Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource nbv}}"
                           Text="{Binding KDKNAME,Source={StaticResource vwMaster},Converter={StaticResource gb2312}}"
                           Width="80" />
            </WrapPanel>
            <DataGrid  Grid.Row="1"  
                       Visibility="Collapsed"
                   VerticalAlignment="Top" 
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"  
                   ItemsSource="{Binding Source={StaticResource vwMaster}}"  
                   IsSynchronizedWithCurrentItem="True" 
                   IsReadOnly="True"
                   x:Name="dlgMaster" 
                   RowDetailsVisibilityMode="Visible"
                   GridLinesVisibility="All"
                   MaxHeight="400"
                >
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=KDKUNDNR}" Header="{Binding Source={Localization:Translate Word=编号}}"  Width="Auto" /> 
                    <DataGridTextColumn Binding="{Binding Path=KDTEL}" Header="{Binding Source={Localization:Translate Word=电话}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=KDFAX}" Header="{Binding Source={Localization:Translate Word=传真}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=KDREGMWST}" Header="{Binding Source={Localization:Translate Word=税}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=KDZENTR}" Header="{Binding Source={Localization:Translate Word=总公司编号}}"  Width="Auto" />
                </DataGrid.Columns>
            </DataGrid  >
        </StackPanel>
    </Grid>
</me:UIKD>
